//
//  ViewController.m
//  OpenGLES
//
//  Created by tianhj on 2018/6/5.
//  Copyright © 2018年 tianhj. All rights reserved.
//
#import "ObjParse.h"
#import "ViewController.h"

@interface ViewController ()
{
    BOOL _check;
    ObjParse *_parse;
}
@property (nonatomic,strong)EAGLContext *context;
@property (nonatomic,weak)GLKView *glView;
@end

@implementation ViewController

- (void)viewDidLoad 
{
    [super viewDidLoad];
    self.glView = (GLKView *)self.view;
    self.context = [[EAGLContext alloc]initWithAPI:kEAGLRenderingAPIOpenGLES2];
    [self.glView setContext:self.context];
    [self.glView setEnableSetNeedsDisplay:YES];
    self.glView.drawableColorFormat = GLKViewDrawableColorFormatRGBA8888;
    _parse = [[ObjParse alloc]initWithFileName:@"Avent.obj"];

    // Do any additional setup after loading the view, typically from a nib.
}


- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
{
    glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT);
    glViewport(0, 0, 300, 300);
    glFlush();
}

@end
